<div class="view-header">
    <div class="view-header-left">

        
        <div class="view-header-item color-open" title="销售车辆"
             ng-click="add_open = !add_open" ng-show="!add_open && !edit_open">
            <i class="fa fa-plus"></i> 销售车辆
        </div>

        <!-- add -->
        <div class="view-header-item color-close above-cover no-widen"
             title="车辆销售--关闭" ng-click="add_open = !add_open"
             ng-show="add_open && !car_open">
            <i class="fa fa-close"></i>
        </div>


        <div class="view-header-item color-check above-cover"
             title="确认提交"
             ng-click='sale_car_add.$valid?submit_add():{};'
             title="确认提交{{sale_car_add.$invalid?'请完成表单后再提交!':''}}"
             ng-show="add_open && !car_open">
            <i class="fa fa-check" ng-show="sale_car_add.$valid"></i>
            <i class="fa fa-ban" ng-show="sale_car_add.$invalid"></i>
            {{sale_car_add.$invalid?'完善表单!':' 确认提交'}}
        </div>


<!--         <div class="view-header-item color-check above-cover" title="车辆销售--确定"
             ng-click="submit_add()" ng-show="add_open && !car_open">
            <i class="fa fa-check"></i> 确认提交
        </div> -->

        <!-- edit-->
        <div class="view-header-item color-close above-cover no-widen"
             title="关闭"
             ng-click="edit_open = !edit_open" ng-show="edit_open">
            <i class="fa fa-close"></i>
        </div>

        <!-- <div class="view-header-item color-check above-cover"
             title="确定" ng-click="submit_edit()"
             ng-show="edit_open">
            <i class="fa fa-check"></i> 确认修改
        </div> -->

        <!-- 选择车辆 -->
        <div class="view-header-item color-close above-cover no-widen"
             title="选择车辆--关闭" ng-click="car_open = false"
             ng-show="car_open">
            <i class="fa fa-close"></i>
        </div>

        <!-- <div class="view-header-item above-cover" title="选择车辆--确定" ng-show="car_open">
            <i class="fa fa-check"></i>
        </div> -->

    </div>

</div>
<div class="view-content ">
    <div ag-grid="grid" class="ag-fresh ag-custom-center" style="height :100%"></div>
</div>

<!-- 销售 -->
<div class="data-overlay" ng-show="add_open">
    <div class="overlay-container">
    	<div class="overlay-header">销售二手车</div>
    	<div ng-form name="sale_car_add" novalidate="novalidate">
	        <div class="overlay-content">
	            <div class="overlay-column overlay-column-4">
		            <div class="overlay-item">
		            	<span class="overlay-name">选择车辆</span>
	            		<input type="text" ng-click="choose_car()" readonly="" placeholder="点击选择一辆车" />
	            		<div class="overlay-item-choose">
	            			<i class="fa fa-chevron-right" style="padding-right:5px;"></i>
	            		</div>
		            </div>
	            	<!-- <div class="overlay-picker" ng-click="choose_car()">选择车辆<i class="fa fa-chevron-right"></i></div> -->
					<div class="overlay-item">
						<span class="overlay-name">入库编号</span>
						<input type="text" ng-model="car_data.stock_sn" disabled=""/>
					</div>
					<div class="overlay-item">
						<span class="overlay-name">入库时间</span>
						<input type="text" disabled="" value="{{car_data.stock_time | date:'yyyy-MM-dd'}}" />
					</div>
					<div class="overlay-item">
						<span class="overlay-name">型号</span>
						<input type="text" ng-model="car_data.version" disabled="" />
					</div>
					<div class="overlay-item">
						<span class="overlay-name">品牌</span>
						<input type="text" ng-model="car_data.brand" disabled="" />
					</div>
					<div class="overlay-item">
						<span class="overlay-name">车型</span>
						<input type="text" ng-model="car_data.model" disabled="" />
					</div>
					<div class="overlay-item">
						<span class="overlay-name">颜色</span>
						<input type="text" ng-model="car_data.color" disabled="" />
					</div>
					<div class="overlay-item">
						<span class="overlay-name">原车主姓名</span>
						<input type="text" ng-model="car_data.origin_customer_name" disabled="" />
					</div>
					<div class="overlay-item">
						<span class="overlay-name">原车主电话</span>
						<input type="text" ng-model="car_data.origin_customer_phone" disabled="" />
					</div>
				</div>
				<div class="overlay-column overlay-column-4">
					<div class="overlay-item">
						<span class="overlay-name">销售顾问</span>
						<salesman-picker ng-required="true" name="salesman" required
                                         ng-model="record_add.salesman"></salesman-picker>
                        <p ng-show = "sale_car_add.salesman.$invalid" class="new-item-bottom">
							请选择销售顾问！
                        </p>
						
					</div>
					<div class="overlay-item">
						<span class="overlay-name">过户服务费</span>
						<input type="number" min="0" step="1" ng-model="record_add.transfer_fee" />
					</div>
					<div class="overlay-item">
						<span class="overlay-name">推荐人</span>
						<input type="text" ng-model="record_add.referral" />
					</div>
					<div class="overlay-item">
						<span class="overlay-name">联系电话</span>
						<input type="text" name="phone" ng-model="record_add.phone" ng-pattern = "/^[0-9]{11}$/" ng-required="true" required/>
						<p ng-show = "sale_car_add.phone.$invalid" class="new-item-bottom">
							请正确填写电话号码！
                        </p>
					</div>
					<div class="overlay-item">
						<span class="overlay-name">日期</span>
						<datetimepicker class="search-date-start"
                        	min-view="2"
                        	ng-model="record_add.sale_date"></datetimepicker>
					</div>
					<div class="overlay-item">
						<span class="overlay-name">推荐人职务</span>
						<select ng-model="record_add.referral_position">
                            <option value="销售">销售</option>
                            <option value="售后">售后</option>
                            <option value="行政">行政</option>
                            <option value="财务">财务</option>
                            <option value="客服">客服</option>
                            <option value="市场">市场</option>
                            <option value="集团">集团</option>
                        </select>
					</div>
				</div>
				<div class="overlay-column overlay-column-4">
				
					<div class="overlay-item">
						<span class="overlay-name">销售类型</span>
						<select ng-model="record_add.sale_type">
							<option value="0">零售</option>
							<option value="1">批发</option>
						</select>
					</div>
					<div class="overlay-item">
						<span class="overlay-name">销售客户来源</span>
						<select ng-model="record_add.customer_source">
                            <option value="展示活动">展示活动</option>
                            <option value="转介绍">转介绍</option>
                            <option value="售后推荐">售后推荐</option>
                            <option value="外展">外展</option>
                        </select>
					</div>
					
					<div class="overlay-item">
						<span class="overlay-name">新车主姓名</span>
						<input type="text" ng-model="record_add.customer_name" />
					</div>
					<div class="overlay-item">
						<span class="overlay-name">销售价</span>
						<input type="number" min="0" step="1" ng-model="record_add.prepare_sale_price" />
					</div>
					<div class="overlay-item">
						<span class="overlay-name">其它销售成本</span>
						<input type="number" min="0" step="1" ng-model="record_add.extra_fee" />
					</div>
					<div class="overlay-item">
						<span class="overlay-name">付款方式</span>
						<select ng-model="record_add.pay_type">
							<option value="cash">现金</option>
							<option value="loan">贷款</option>
						</select>
					</div>
					<div class="overlay-item" ng-show="record_add.pay_type == 'loan'">
                        <span class="overlay-name">贷款机构</span>
                        <input type="text" ng-model="record_add.loan_org">
                    </div>
                    <div class="overlay-item" ng-show="record_add.pay_type == 'loan'">
                        <span class="overlay-name">贷款到期日</span>
                        <datetimepicker class="search-date-start"
                        	min-view="2"
                        	ng-model="record_add.loan_expiration"></datetimepicker>
                    </div>
					
				</div>
				<div class="overlay-column overlay-column-4">
					<div class="overlay-item">
                        <span class="overlay-name">保险</span>
                        <div class="overlay-item-insurance">
                            <label>
                                是
                                <input type="radio" name="insurance-" value="1" ng-model="record_add.insurance_flag">
                            </label>
                            <label>
                                否
                                <input type="radio" name="insurance-" value="0" ng-model="record_add.insurance_flag">
                            </label>
                        </div>

                    </div>
                    <div class="overlay-item" ng-show="record_add.insurance_flag == 1">
	                    <span class="overlay-name">保险公司</span>
	                    <select ng-model="record_add.insurance_company">
	                        <option>人保</option>
	                        <option>太平洋</option>
	                        <option>平安</option>
	                        <option>中华联合</option>
	                        <option>紫金</option>
	                        <option>大地</option>
	                        <option>中国人寿</option>
	                        <option>阳光</option>
	                    </select>
	                </div>
	                <div class="overlay-item" ng-show="record_add.insurance_flag == 1">
	                    <span class="overlay-name">保单号</span>
	                    <input type="text" ng-model="record_add.insurance_sn">
	                </div>
	                <div class="overlay-item" ng-show="record_add.insurance_flag == 1">
	                    <span class="overlay-name">保险到期日</span>
	                    <datetimepicker class="search-date-start"
                        	min-view="2"
                        	ng-model="record_add.due_date"></datetimepicker>
	                </div>
	                <div class="overlay-item" ng-show="record_add.insurance_flag == 1">
	                    <span class="overlay-name">保险金额</span>
	                    <input type="number" min="0" step="1" ng-model="record_add.insurance_amount">
	                </div>
	                <!-- <div class="overlay-item" ng-show="record_add.insurance_flag == 1">
	                    <span class="overlay-name">延保品牌</span>
	                    <select ng-model="record_add.extended_insurance">
	                        <option>华成延保</option>
	                        <option>厂商延保</option>
	                    </select>
	                </div> -->
				</div>
	        </div>
	    </div>
    </div>
</div>

<!-- edit -->
<div class="data-overlay" ng-show="edit_open">
    <div class="overlay-container">
    	<div class="overlay-header">二手车信息查看</div>
    	<div ng-form name="edit_form" novalidate="novalidate">
	        <div class="overlay-content">
	            <div class="overlay-column overlay-column-4">
					<div class="overlay-item">
						<span class="overlay-name">入库编号</span>
						<input type="text" ng-model="edit_data.stock_sn" disabled=""/>
					</div>
					<div class="overlay-item">
						<span class="overlay-name">入库时间</span>
						<input type="text" disabled="" value="{{edit_data.stock_time | date:'yyyy-MM-dd'}}" />
					</div>
					<div class="overlay-item">
						<span class="overlay-name">型号</span>
						<input type="text" ng-model="edit_data.version" disabled="" />
					</div>
					<div class="overlay-item">
						<span class="overlay-name">品牌</span>
						<input type="text" ng-model="edit_data.brand" disabled="" />
					</div>
					<div class="overlay-item">
						<span class="overlay-name">车型</span>
						<input type="text" ng-model="edit_data.model" disabled="" />
					</div>
					<div class="overlay-item">
						<span class="overlay-name">颜色</span>
						<input type="text" ng-model="edit_data.color" disabled="" />
					</div>

				</div>
				<div class="overlay-column overlay-column-4">
					<div class="overlay-item">
						<span class="overlay-name">销售顾问</span>
						<input type="text" disabled="" ng-model="edit_data.salesman" />
						
					</div>
					<div class="overlay-item">
						<span class="overlay-name">过户服务费</span>
						<input type="text" disabled="" ng-model="edit_data.transfer_fee" />
					</div>
					<div class="overlay-item">
						<span class="overlay-name">推荐人</span>
						<input type="text" disabled="" ng-model="edit_data.referral" />
					</div>
					<div class="overlay-item">
						<span class="overlay-name">联系电话</span>
						<input type="text" name="phone" disabled="" ng-model="edit_data.phone"/>
					</div>
					<div class="overlay-item">
						<span class="overlay-name">日期</span>
						<input type="text" disabled="" value="{{edit_data.sale_date | date:'yyyy-MM-dd'}}" />
					</div>
					<div class="overlay-item">
						<span class="overlay-name">推荐人职务</span>
						<select disabled="" ng-model="edit_data.referral_position">
                            <option value="销售">销售</option>
                            <option value="售后">售后</option>
                            <option value="行政">行政</option>
                            <option value="财务">财务</option>
                            <option value="客服">客服</option>
                            <option value="市场">市场</option>
                            <option value="集团">集团</option>
                        </select>
					</div>
				</div>
				<div class="overlay-column overlay-column-4">
				
					<div class="overlay-item">
						<span class="overlay-name">销售类型</span>
						<select disabled="" ng-model="edit_data.sale_type">
							<option value="0">零售</option>
							<option value="1">批发</option>
						</select>
					</div>
					<div class="overlay-item">
						<span class="overlay-name">销售客户来源</span>
						<select disabled="" ng-model="edit_data.customer_source">
                            <option value="展示活动">展示活动</option>
                            <option value="转介绍">转介绍</option>
                            <option value="售后推荐">售后推荐</option>
                            <option value="外展">外展</option>
                        </select>
					</div>
					
					<div class="overlay-item">
						<span class="overlay-name">新车主姓名</span>
						<input type="text" disabled="" ng-model="edit_data.customer_name" />
					</div>
					<div class="overlay-item">
						<span class="overlay-name">销售价</span>
						<input type="text" disabled="" ng-model="edit_data.prepare_sale_price" />
					</div>
					<div class="overlay-item">
						<span class="overlay-name">其它销售成本</span>
						<input type="text" disabled="" ng-model="edit_data.extra_fee" />
					</div>
					<div class="overlay-item">
						<span class="overlay-name">付款方式</span>
						<select disabled="" ng-model="edit_data.pay_type">
							<option value="cash">现金</option>
							<option value="loan">贷款</option>
						</select>
					</div>
					<div class="overlay-item" ng-show="record_add.pay_type == 'loan'">
                        <span class="overlay-name">贷款机构</span>
                        <input type="text" disabled="" ng-model="edit_data.loan_org">
                    </div>
                    <div class="overlay-item" ng-show="record_add.pay_type == 'loan'">
                        <span class="overlay-name">贷款到期日</span>
                        <input type="text" disabled="" value="{{edit_data.loan_expiration | date:'yyyy-MM-dd'}}"/>
                    </div>
					
				</div>
				<div class="overlay-column overlay-column-4">
					<div class="overlay-item">
                        <span class="overlay-name">保险</span>
                        <select disabled="" ng-model="edit_data.insurance_flag">
							<option value="1">是</option>
							<option value="0">否</option>
						</select>
                        <!-- <div class="overlay-item-insurance">
                            <label>
                                是
                                <input type="radio" name="insurance-" value="1" disabled="" ng-model="edit_data.insurance_flag">
                            </label>
                            <label>
                                否
                                <input type="radio" name="insurance-" value="0" disabled="" ng-model="edit_data.insurance_flag">
                            </label>
                        </div> -->

                    </div>
                    <div class="overlay-item" ng-show="edit_data.insurance_flag == 1">
	                    <span class="overlay-name">保险公司</span>
	                    <select disabled="" ng-model="edit_data.insurance_company">
	                        <option>人保</option>
	                        <option>太平洋</option>
	                        <option>平安</option>
	                        <option>中华联合</option>
	                        <option>紫金</option>
	                        <option>大地</option>
	                        <option>中国人寿</option>
	                        <option>阳光</option>
	                    </select>
	                </div>
	                <div class="overlay-item" ng-show="edit_data.insurance_flag == 1">
	                    <span class="overlay-name">保单号</span>
	                    <input type="text" disabled="" ng-model="edit_data.insurance_sn">
	                </div>
	                <div class="overlay-item" ng-show="edit_data.insurance_flag == 1">
	                    <span class="overlay-name">保险到期日</span>
	                    <input type="text" disabled="" value="{{edit_data.due_date | date:'yyyy-MM-dd'}}"/>
	                </div>
	                <div class="overlay-item" ng-show="edit_data.insurance_flag == 1">
	                    <span class="overlay-name">保险金额</span>
	                    <input type="number" min="0" step="1" disabled="" ng-model="edit_data.insurance_amount">
	                </div>
	                <div class="overlay-item" ng-show="edit_data.insurance_flag == 1">
	                    <span class="overlay-name">延保品牌</span>
	                    <select disabled="" ng-model="edit_data.extended_insurance">
	                        <option>华成延保</option>
	                        <option>厂商延保</option>
	                    </select>
	                </div>
				</div>
		    </div>
		</div>
	</div>
</div>









<div class="data-overlay" ng-show="car_open">
    <div class="overlay-container no-scroll">
    	<div class="overlay-header">选择车辆</div>
    </div>
    <div class="overlay-content-ag">
    	<div ag-grid="car_kpi" class="ag-fresh ag-custom-center" style="height :100%"></div>
    </div>
</div>
